import java.io.*;

public class BufferReaderDemo {
    public static void main(String[] args) {
        try(
                Reader fr = new FileReader("file-io\\src\\data4.txt");
                BufferedReader br = new BufferedReader(fr);//这里没用多态是为了用BufferedReader的独有方法
                ) {
            String a;
            //readLine的返回值是String,结束有null
            while((a = br.readLine())!=null){
                System.out.println(a);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
